// 安卓申请权限时，同步弹窗告知
class AndroidPermissionsPoup {
	constructor(title,content){
		this.view = null;
		this.systemInfo = uni.getSystemInfoSync();
		this.statusBarHeight = this.systemInfo.statusBarHeight;
		this.navigationBarHeight = this.systemInfo.platform === 'android' ? 48 :44;
		this.totalHeight = this.statusBarHeight + this.navigationBarHeight;
		this.view = new plus.nativeObj.View('per-modal', {
		    top: '0px',
		    left: '0px',
		    width: '100%',
		    backgroundColor: '#444',
		    //opacity: .5;
		})
		this.view.drawRect({
		    color: '#fff',
		    radius: '5px'
		}, {
		    top: this.totalHeight + 'px',
		    left: '5%',
		    width: '90%',
		    height: "100px",
		})
		// 标题
		this.view.drawText(title, {
		    top: this.totalHeight + 5 + 'px',
		    left: "8%",
		    height: "30px"
		}, {
		    align: "left",
		    color: "#000",
		}, {
		    onClick: function (e) {
		        console.log(e);
		    }
		})
		// 内容描述
		this.view.drawText(content, {
		    top: this.totalHeight + 35 + 'px',
		    height: "60px",
		    left: "8%",
		    width: "84%"
		}, {
		    whiteSpace: 'normal',
		    size: "14px",
		    align: "left",
		    color: "#656563"
		})
	}
	show(){
		this.view = plus.nativeObj.View.getViewById('per-modal');
		this.view.show();
		this.view = null;
	}
	close(){
		this.view = plus.nativeObj.View.getViewById('per-modal');
		this.view.close();
		this.view = null;
	}
}
export default AndroidPermissionsPoup